package cn.webrx;

public class NewDemo {
    public static void main(String[] args) {
        String a = new String("ok");
        System.out.println(a.hashCode());

        String b = new String("ok");
        System.out.println(b.hashCode());

        System.out.println(a == b); //false 代表两个对象 是不是一个对象
        System.out.println(a.equals(b));//true 代表内容是不是相等

        System.out.println("---------------------");
        Book b1 = new Book(10,"java书籍");
        System.out.println(b1.hashCode());
        Book b2 = new Book(11,"java书籍");
        System.out.println(b2.hashCode());
        System.out.println(b1 == b2);


        System.out.println(b1.equals(b2));
    }
}
